const path=require('path')
const HtmlWebpackPlugin = require("html-webpack-plugin");
const CopyWebpackPlugin=require('copy-webpack-plugin')
module.exports={
    mode:'production',
    entry:path.resolve(process.cwd(),'./src/index.js'),
    output:{
        path:path.resolve(process.cwd(),'./dist'),
        filename:"[name].js"
    },
    plugins: [
        new HtmlWebpackPlugin({
             title: "admin",
             filename: "index.html",
             template: "./public/index.html"
       }) ,
       new CopyWebpackPlugin({
        patterns: [{
            from: "public",
            to: "./",
            globOptions: {
                ignore: ["**/index.html"] // 排除index.html
            }
        }]
})
     ]
}